The big winners and losers from the Trump administration’s deal with Democrats on its NAFTA replacement, the U.S.-Mexico-Canada Agreement, are not necessarily the traditional ones.

Pharmaceutical companies, which usually see gains from trade deals, got their big promise ripped out of the final agreement. But it gives labor groups, most notably the AFL-CIO, the first trade deal it could support in nearly two decades because of strong enforcement of labor rules.

The compromise leaves a three-nation, $1.4 trillion free trade zone largely unchanged for agricultural exporters. And it tightens auto supply chains accused of bleeding jobs to Mexico.

Here’s how the Trump administration managed to thread the needle to attain what could be one of the most bipartisan trade deals in history:

How this deal is different from NAFTA.

The deal overhauls the 25-year-old NAFTA by establishing new rules for the internet age and imposing higher costs on auto companies that have plants in Mexico. And for the first time, violations of the agreement’s labor and environment rules can be redressed with penalties. It also removes certain protections for foreign investors while adding in provisions to prevent currency manipulation.